#ifndef _MY_MQTT_H
#define _MY_MQTT_H
#include <Arduino.h>
#include <WiFi.h>

#include "PubSubClient.h"
#include "Client.h"

#include "../MyEEPROM/MySetting.h"

class MyMQTT
{
private:
    const char *_WIFI_SSID = WIFI_SSID;
    const char *_WIFI_PASS = WIFI_PASS;
    const char *_WIFI_STA_NAME = WIFI_STA_NAME;

    const char *_MQTT_SERVER = MQTT_SERVER;
    const int _MQTT_PORT = MQTT_PORT;
    const char *_MQTT_USER = MQTT_USER;
    const char *_MQTT_PASS = MQTT_PASS;

    PubSubClient *client;

    void setup_wifi();

public:
    const char *topic = MQTT_PUBLISH_TOPIC;
    char mac[24];
    MyMQTT(PubSubClient &PubSubClient);
    ~MyMQTT();
    void reconnect();
};

#endif